package com.ruan.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruan.entity.Expert;
import com.ruan.entity.R;
import com.ruan.service.ExpertService;
import com.ruan.mapper.ExpertMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author 59499
* @description 针对表【tb_expert】的数据库操作Service实现
* @createDate 2023-09-20 15:00:05
*/
@Service
public class ExpertServiceImpl extends ServiceImpl<ExpertMapper, Expert>
    implements ExpertService{

    @Autowired
    private  ExpertMapper expertMapper;

    @Override
    public R<List<Expert>> getExpert() {
        QueryWrapper<Expert> wrapper = new QueryWrapper<>();
        wrapper.last("LIMIT 4");
        List<Expert> expertList = expertMapper.selectList(wrapper);
        return R.ok("查询成功",expertList);
    }
}




